package com.eiei.bean;

import java.io.Serializable;
import java.util.Date;

/*
	sql
	create table t_message(
		id         varchar(32),
		content    varchar(5000),
		sender     varchar(255),
		reciver    varchar(255),
		status     varchar(10),
		createdDate   DATETIME,
		primary key (id)
	)


 */


/**
 * 消息体信息映射类
 * @author eiei
 * @since 2013-08-04 23:27
 */
public class MessageBean implements Serializable{
	
	public static final String READED = "readed";
	
	public static final String UNREADER = "unread";

	private static final long serialVersionUID = -5315055618256629970L;

	/**
	 * 主键格式：useryyyyMMddHHmmssSSSRRRR
	 */
	private String id;
	
	/**
	 * 内容发送的时候，经过blowfish加密。保存到数据库的时候，明文保存
	 */
	private String content;
	
	/**
	 * 发送人：eiei,丫头
	 */
	private String sender;
	/**
	 * 接受人：eiei，丫头
	 */
	private String reciver;
	
	/**
	 * 信息生成时间，以邮件时间为准
	 */
	private Date createDate;
	
	private String status;

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getSender() {
		return sender;
	}

	public void setSender(String sender) {
		this.sender = sender;
	}

	public String getReciver() {
		return reciver;
	}

	public void setReciver(String reciver) {
		this.reciver = reciver;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@Override
	public String toString() {
		return "MessageBean [id=" + id + ", content=" + content + ", sender="
				+ sender + ", reciver=" + reciver + ", createDate="
				+ createDate + ", status=" + status + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		MessageBean other = (MessageBean) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}
	
	
	
}
